{% extends "fnr/base.html" %}
{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
  - http://heavyz.blogspot.com/
  - http://buggarden.blogspot.com/

  Display a resto list, which may be the search results by tag, by post code, or by city.
  
  Created on 2008-10-29.
  $Id: resto_list.html 271 2008-11-10 14:43:10Z heavyzheng $
-->
{% endcomment %}

{# ---------------------------------------------------------------------------------------------- #}

{% block html_head %}

<link rel="stylesheet" type="text/css" media="screen" href="/static/fnr/stylesheets/resto_list.css"/>
<title>{{ resto_count }} restos found :: Foods N' Roses</title>

{% endblock %}{# html_head #}

{# ---------------------------------------------------------------------------------------------- #}

{% block content %}

<div class="title">
  {% ifequal criterion "post_code" %}
    Restos with post code {{ value }}...
  {% endifequal %}
  {% ifequal criterion "city" %}
    Restos in {{ value.capitalize }}...
  {% endifequal %}
  {% ifequal criterion "tags" %}
    Restos with tag "{{ value }}"...
  {% endifequal %}
  {% ifequal criterion "best_dishes" %}
    Restos that are good at cooking {{ value }}...
  {% endifequal %}
</div>

<div class="subtitle">Total {{ restos.object_count }} restos found.</div>

<div id="restos">

  {% for resto in restos.object_list %}

    <div class="resto">
    
      <div class="resto-name">
        <a href="/fnr/resto/{{ resto.uid }}/">{{ resto.full_name }}</a>
      </div><!--/.resto-name-->
      
      <div class="resto-address">
        {{ resto.address|default:"" }}
        .
        {{ resto.post_code|default:"" }}
        {{ resto.city.capitalize|default:"" }}
      </div><!--/.resto-address-->
      
      <div class="resto-desc">
        {{ resto.desc|default:""|escape }}
      </div><!--/.resto-desc-->
    
    </div><!--/.resto-->
  
  {% endfor %}{# resto in restos #}

</div>

<div class="pagination">

  {% if restos.has_previous %}
    <span class="page"><a href=".?page={{ restos.previous_page_number }}">Prev</a></span>
  {% else %}
    <span class="page">Prev</span>
  {% endif %}
  
  {% if not restos.is_first_page_in_range %}
    <span class="page"><a href=".?page={{ restos.first_page_number }}">{{ restos.first_page_number }}</a></span>
  {% endif %}
  
  {% for page in restos.previous_page_range %}
    <span class="page"><a href=".?page={{ page }}">{{ page }}</a></span>
  {% endfor %}
  
  <span class="page"><b>{{ restos.number }}</b></span>
  
  {% for page in restos.next_page_range %}
    <span class="page"><a href=".?page={{ page }}">{{ page }}</a></span>
  {% endfor %}
  
  {% if not restos.is_last_page_in_range %}
    <span class="page"><a href=".?page={{ restos.last_page_number }}">{{ restos.last_page_number }}</a></span>
  {% endif %}
  
  {% if restos.has_next %}
    <span class="page"><a href=".?page={{ restos.next_page_number }}">Next</a></span>
  {% else %}
    <span class="page">Next</span>
  {% endif %}

</div>

{% endblock %}{# content #}


